package com.itheima.exer.exercise.ex0924;

public class Demo12 {
    public static void main(String[] args) {
        int result = getResult(5);
        System.out.println(result);
    }

    private static int getResult(int i) {
        if (i == 1) {
            return 1;
        } else {
            return i * getResult(i - 1);
        }
    }
}
